<template>
    <SearchTablePage :search-config="baseTableSearchModel" :table-config="baseTableModel" />
</template>

<script lang="ts" setup>
defineOptions({
    name: 'StoreInfoOutBatchDetailPageData',   //全局别名
    title: '表格页',   //标题
});
// 接口
import StoreInfoOutBatchDetailApi from '/@/api//StoreInfoOutBatchDetailApi.ts';

import StoreInfoApi from '~/src/api/webPath/StoreInfoApi';

// const storeList = ref()
// onMounted(async () => {
//     // TODO 更换为全量获取仓库列表
//     const data = (await StoreInfoApi.getPageData({})).data
//     console.log("data:", data)
//     storeList.value = data.records.map(item => ({ label: item.storeName, value: item.storeName }))
//     console.log("supplierTypeList", storeList.value)
// })

const props = defineProps<{
    modelValue: {
        query: {
            storeId: any
            materialName: any
        }
    }
}>();
// 表格搜索初始化searchModel
// 表格初始化Model
const baseTableModel = ref({
    border: true,
    pagination: true,
    inline: true,
    selectable: true,
    isFullscreen: false,
    minWidth: '200px',
    data: {    //table  初始化
        current: 1,
        size: 10,
        total: 100,
        data: []
    },
    requestData: {
        api: StoreInfoOutBatchDetailApi.getPageData, query: {
            storeId: props.modelValue.query.storeId,
            materialName: props.modelValue.query.materialName
        }
    },   //数据源 参数有效性： 'steady|transient'
    columns: [

        {
            label: "仓库类型",
            field: "storeType",
            width: 180,
        },
        {
            label: "领用日期",
            field: "outDate",
            width: 200,
            // noExported: true,
            fieldFormat: "date"
        },
        {
            label: "物料编码",
            field: "materialCode",
            width: 180,
        },
        {
            label: "物料名称",
            field: "materialName",
            width: 190,
        },
        {
            label: "规格",
            field: "materialSpc",
            width: 180,
        },
        {
            label: "出库数量",
            field: "outNum",
            width: 120,
        },
        {
            label: "当前库存",
            field: "inventoryNum",
            width: 120,
        },

        {
            label: "创建时间",
            field: "create_time",
        },
        {
            label: "更新时间",
            field: "update_time",
        },
    ],

})



onActivated(() => {
})



</script>
